<?php


namespace App\Models\MainDB;


use Illuminate\Database\Eloquent\Model;

class SugarActivityLog extends Model
{
    protected $table = 'ln_sugar_activity_log';     //数据库内完整表名

    protected $primaryKey = 'id';    //主键名

    protected $fillable = [
        'id',      //主键ID
        'activity_id',
        'user_id',
        'consume_sugar_num',
        'consume_point_num',
        'gift_id',
        'create_time',
        'update_time',
    ];
    public $timestamps = false;

    public function gift_info()
    {
        return $this->hasOne('App\Models\MainDB\Gift', 'id', 'gift_id');
    }

    public function user_data()
    {
        return $this->hasOne('App\Models\MainDB\UserData', 'user_id', 'user_id');
    }
}